<template>
    <div class="section">
        <div class="header">
            <h2 class="title">{{ headerText }}</h2>
        </div>
        <div class="content">
            <slot>默认内容</slot>
        </div>
        <div class="footer" v-if="moreText.length">
            查看{{ moreText }}
            <van-icon name="arrow" />
        </div>
    </div>
</template>

<script setup>
defineProps({
    headerText: {
        Object: String,
        default: "默认标题"
    },
    moreText: {
        Object: String,
        default: ""
    }
})
</script>

<style lang="less" scoped>
.section {
    margin-top: 10px;
    padding: 0 16px;

    .header {
        height: 52px;
        line-height: 52px;
        border-bottom: 1px solid  #DCDCDC;

        h2 {
            color: #333;
            font-size: 20px;
            font-weight: 600;
        }
    }

    .content{
        margin-top: 20px;
    }

    .footer{
        display: flex;
        justify-content: flex-end;
        align-items: center;

        padding: 15px 16px;
        color: var(--primary-color);
        font-weight: 600;
    }
}
</style>